﻿/// <reference path="jquery-1.7.1.min.js"/> 

$(document).ready(function () {
    myLayout = $('body').layout({
        west__size: 0
		, east__size: 180
        , north__size: 50
		, west__onresize: $.layout.callbacks.resizePaneAccordions
		, east__onresize: $.layout.callbacks.resizePaneAccordions
    });

    var index = $.cookie("accordion");
    var active;
    if (index !== null) {
        active = $("#accordion2").find("h3:eq(" + index + ")");
    } else {
        active = 1
    }

    $("#accordion1").accordion({ fillSpace: true });
    $("#accordion2").accordion({ fillSpace: true, active: active,
        change: function (event, ui) {
            var index = $(this).find("h3").index(ui.newHeader[0]);
            $.cookie("accordion", index, {
                path: "/"
            });
        }
    });
    $('#switcher').themeswitcher();
    //setTimeout(myLayout.resizeAll, 1000);
});